﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using MDL;
using DAL;

namespace BLL
{
    public class BLL_Admins
    {
        /// <summary>
        /// 查询登录是否成功
        /// </summary>
        /// <param name="s"></param>
        /// <returns>登录人信息</returns>
        public static Admins LoginSelect(Admins s)
        {
            return DAL_Admins.LoginSelect(s);
        }
        /// <summary>
        /// 解锁查询登录信息
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns>是否有</returns>
        public static Admins JiSuoSelect(string name, string pwd)
        {
            return DAL_Admins.JiSuoSelect(name,pwd);
        }
        /// <summary>
        /// 查询管理信息
        /// </summary>
        /// <returns>管理信息</returns>
        public static List<Admins> SelectAdmin()
        {
            return DAL_Admins.SelectAdmin();
        }
        /// <summary>
        /// 增加用户名
        /// </summary>
        /// <param name="yname">用户名</param>
        /// <param name="pwd">密码</param>
        /// <param name="zname">真实姓名</param>
        /// <returns>受影响的行数</returns>
        public static int AddAdmin(string yname, string pwd, string zname)
        {
            return DAL_Admins.AddAdmin(yname, pwd, zname);
        }
        /// <summary>
        /// 修改管理员信息
        /// </summary>
        /// <param name="yname">用户名</param>
        /// <param name="zname">真实姓名</param>
        /// <param name="id">根据用户ID</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateAdmin(string yname, string zname, int id)
        {
            return DAL_Admins.UpdateAdmin(yname, zname, id);
        }
        /// <summary>
        /// 查询是否已存在次用户名
        /// </summary>
        /// <param name="name">根据用户名</param>
        /// <returns>是否有</returns>
        public static List<Admins> SelectAdmins(string name)
        {
            return DAL_Admins.SelectAdmins(name);
        }
        /// <summary>
        /// 删除管理信息
        /// </summary>
        /// <param name="id">根据用户ID</param>
        /// <returns>受影响的行数</returns>
        public static int DeleteAdmin(int id)
        {
            return DAL_Admins.DeleteAdmin(id);
        }
        /// <summary>
        /// 下拉绑定操作人信息
        /// </summary>
        /// <returns></returns>
        public static List<Admins> SelectXl()
        {
            return DAL_Admins.SelectXl();
        }
        /// <summary>
        /// 查询等级人类型ID
        /// </summary>
        /// <param name="id">类型ID</param>
        /// <returns></returns>
        public static List<Admins> SelectQuanXie(int id)
        {
            return DAL_Admins.SelectQuanXie(id);
        }
        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="XPwd">新密码</param>
        /// <param name="Name">根据用户名</param>
        /// <param name="JPwd">根据原密码</param>
        /// <returns>受影响的行数</returns>
        public static int UpdatePwd(string XPwd, string Name, string JPwd)
        {
            return DAL_Admins.UpdatePwd(XPwd, Name, JPwd);
        }
    }
}
